import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/login",
    component: () => import("../pages/login/Login.vue"),
  },
  {
    path: "/home",
    name: "Home",
    component: () => import("../pages/home/Home.vue"),
    children: [
      {
        path: "/home", //首页
        component: () => import("../pages/index/Index.vue"),
        mate: { title: "首页", icon: "iconshouye" },
      },
      {
        path: "/deals", //交易管理
        name: "Deals",
        component: () => import("../pages/deals/Index.vue"),
        mate: { title: "交易管理", icon: "iconneirongguanli" },
        redirect: "/deals/orders",
        children: [
          {
            path: "orders", //订单管理
            name: "Orders",
            component: () => import("../pages/deals/Orders.vue"),
            mate: { title: "订单管理", icon: "iconneirongguanli" },
          },
          {
            path: "tradesum", //交易金额
            name: "Tradesum",
            component: () => import("../pages/deals/Tradesum.vue"),
            mate: { title: "交易金额", icon: "iconneirongguanli" },
          },
          {
            path: "handleorder", //订单处理
            name: "Handleorder",
            component: () => import("../pages/deals/Handleorder.vue"),
            mate: { title: "订单处理", icon: "iconneirongguanli" },
          },
          {
            path: "refund", //退款管理
            name: "Refund",
            component: () => import("../pages/deals/Refund.vue"),
            mate: { title: "退款管理", icon: "iconneirongguanli" },
          },
        ],
      },
      {
        path: "/goodsmang", //商品管理
        name: "Goodsmang",
        component: () => import("../pages/goodsmang/Index.vue"),
        mate: { title: "商品管理", icon: "iconshangpin" },
        redirect: "/goodsmang/goodslist",
        children: [
          {
            path: "goodslist", //商品列表
            name: "Goodslist",
            component: () => import("../pages/goodsmang/Goodslist.vue"),
            mate: { title: "商品列表", icon: "iconsucaiku" },
          },
          {
            path: "goodslistup", //订单管理上架
            name: "Goodslistup",
            component: () => import("../pages/goodsmang/Goodslistup.vue"),
            mate: { title: "新增商品", icon: "iconsucaiku" },
          },
          {
            path: "goodscategory", //订单管理下架
            name: "Goodscategory",
            component: () => import("../pages/goodsmang/Goodscategory.vue"),
            mate: { title: "版型分类", icon: "iconsucaiku" },
          },
          {
            path: "goodcate", //订单管理-删除
            name: "Goodcate",
            component: () => import("../pages/goodsmang/Goodcate.vue"),
            mate: { title: "商品分类" },
          },
        ],
      },
      {
        path: "/authority", //权限管理
        name: "Authority",
        component: () => import("../pages/authority/Index.vue"),
        mate: { title: "权限管理", icon: "iconquanxian" },
        redirect: "/authority/roles",
        children: [
          {
            path: "roles", //角色列表
            name: "Roles",
            component: () => import("../pages/authority/Roles.vue"),
            mate: { title: "角色列表", icon: "iconsucaiku" },
          },
          {
            path: "authority", //权限列表
            name: "Authority",
            component: () => import("../pages/authority/Authority.vue"),
            mate: { title: "权限列表", icon: "iconsucaiku" },
          },
        ],
      },

      {
        path: "/category", //分类列表
        name: "Category",
        component: () => import("../pages/category/Index.vue"),
        mate: { title: "分类列表", icon: "icondingdanguanli" },
      },
      {
        path: "/capitalmang", //资金管理
        name: "Capitalmang",
        component: () => import("../pages/capitalmang/Index.vue"),
        mate: { title: "资金管理", icon: "iconzijinshouyi" },
        redirect: "/capitalmang/withdrawal",
        children: [
          {
            path: "withdrawal", //提现操作
            name: "Withdrawal",
            component: () => import("../pages/capitalmang/Withdrawal.vue"),
            mate: { title: "提现操作", icon: "iconzijinshouyi" },
          },
          {
            path: "withdrecord", //订单管理上架
            name: "Withdrecord",
            component: () => import("../pages/capitalmang/Withdrecord.vue"),
            mate: { title: "订单管理上架", icon: "iconzijinshouyi" },
          },
        ],
      },
      {
        path: "/helpcent", //帮助中心
        name: "Helpcent",
        component: () => import("../pages/helpcent/Helpcent.vue"),
        mate: { title: "帮助中心", icon: "iconbangzhuzhongxin" },
      },
    ],
  },
];
export default createRouter({
  history: createWebHistory(),
  routes: routes,
});
